NAMESPACE=iot
MODULE=oa-user
#IMAGE_REPO=47.92.71.9:5000
IMAGE_REPO=192.168.180.142:8088
VERSION=v1.0
BUILD := `git rev-parse --short HEAD`
TAG := ${VERSION}-${BUILD}


build:
	@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${MODULE}

image: build
	@docker build -t ${IMAGE_REPO}/${NAMESPACE}/${MODULE}:${TAG} .
	@echo ${IMAGE_REPO}/${NAMESPACE}/${MODULE}:${TAG}

push: image
	@docker push ${IMAGE_REPO}/${NAMESPACE}/${MODULE}:${TAG}
	@echo
	@echo ${IMAGE_REPO}/${NAMESPACE}/${MODULE}:${TAG}

.PHONY: image build